package com.zhangwei.fresco.callbacks;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;

import com.zhangwei.fresco.utils.ActivitiesManager;

/**
 * api >=14
 *
 * @version V1.0
 * @description:
 * @title: Expands
 * @package com.zhangwei.fresco.callbacks
 * @author: zhangwei
 * @date: 2015-12-23 下午4:00
 */
public class AppActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {


    @Override
    public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
        ActivitiesManager.getAppManager().addActivity(activity);
    }

    @Override
    public void onActivityStarted(Activity activity) {

    }

    @Override
    public void onActivityResumed(Activity activity) {

    }

    @Override
    public void onActivityPaused(Activity activity) {

    }

    @Override
    public void onActivityStopped(Activity activity) {

    }

    @Override
    public void onActivitySaveInstanceState(Activity activity, Bundle outState) {

    }

    @Override
    public void onActivityDestroyed(Activity activity) {
        ActivitiesManager.getAppManager().finishActivity(activity);
    }

}
